{extend name="base" /} {block name="body"}
<style>
    .coverBox {
        position: absolute;
        right: 25px;
        bottom: 10px;
        z-index: 1000;
        background: #fff;
        height: 300px;
        width: 450px;
    }

    .coverBox span {
        position: absolute;
        background: rgba(10, 10, 10, .4);
        padding: 5px;
        bottom: 1px;
        cursor: pointer;
        font-size: 10px;
        color: #ffffff;
    }

    .coverBox img {
        width: 100%;
        height: 100%;
    }

    .coverBox .recheck {
        right: 1px;
    }

    .coverBox .removeCove {
        left: 1px;
    }
</style>
<!--tab标签-->
<div class="layui-tab layui-tab-brief">
    <ul class="layui-tab-title">
        <li class="layui-this">SEO配置</li>
        <li>基本配置</li>
<!--        <li>显示配置</li>-->
    </ul>


    <form class="layui-form form-container layui-tab-content" data-url="{:url('admin/system/updateSiteConfig')}" localtion-url="{:url('admin/system/siteConfig')}">

        <div class="layui-tab-item layui-show">

            <div class="layui-form-item">
                <label class="layui-form-label">网站标题</label>
                <div class="layui-input-inline">
                    <input type="text" name="site_config[site_title]" value="{$site_config.site_title|default=''}" required lay-verify="required" placeholder="请输入网站标题" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">SEO标题</label>
                <div class="layui-input-block">
                    <input type="text" name="site_config[seo_title]" value="{$site_config.seo_title|default=''}" placeholder="请输入SEO标题" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">SEO关键字</label>
                <div class="layui-input-block">
                    <input type="text" name="site_config[seo_keyword]" value="{$site_config.seo_keyword|default=''}" placeholder="请输入SEO关键字" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">SEO说明</label>
                <div class="layui-input-block">
                    <textarea name="site_config[seo_description]" placeholder="请输入SEO说明" class="layui-textarea">{$site_config.seo_description|default=''}</textarea>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">版权信息</label>
                <div class="layui-input-block">
                    <input type="text" name="site_config[site_copyright]" value="{$site_config.site_copyright|default=''}" placeholder="请输入版权信息" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">站长QQ</label>
                <div class="layui-input-block">
                    <input type="text" name="site_config[webmaster_qq]" value="{$site_config.webmaster_qq|default='278198348'}" placeholder="站长QQ" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">站长邮箱</label>
                <div class="layui-input-block">
                    <input type="text" name="site_config[webmaster_email]" value="{$site_config.webmaster_email|default='278198348@qq.com'}" placeholder="站长信箱" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">交流群链接</label>
                <div class="layui-input-block">
                    <input type="text" name="site_config[qq_group]" value="{$site_config.qq_group|default=''}" placeholder="QQ群链接" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">联系方式</label>
                <div class="layui-input-block">
                    <input type="text" name="site_config[contact]" value="{$site_config.contact|default=''}" placeholder="联系方式" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">ICP备案号</label>
                <div class="layui-input-block">
                    <input type="text" name="site_config[site_icp]" value="{$site_config.site_icp|default=''}" placeholder="请输入版权信息" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">网站公告</label>
                <div class="layui-input-block">
                    <textarea name="site_config[site_notice]" class="layui-textarea">{$site_config.site_notice|default=''}</textarea>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">统计代码</label>
                <div class="layui-input-block">
                    <textarea name="site_config[site_tongji]" placeholder="请输入统计代码" class="layui-textarea">{$site_config.site_tongji|default=''}</textarea>
                </div>
            </div>


        </div>
        <div class="layui-tab-item">

            <div class="layui-form-item">
                <div class="layui-form-item">
                    <div>
                        <label class="layui-form-label">后台安全路径</label>
                        <div class="layui-input-inline">
                            <input type="text" name="site_config[safe_dir]" value="{$site_config.safe_dir|default=''}"  placeholder="安全路径" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="label-tint">设置安全路径后你的后台地址为  网址/admin/login/index/v/安全路径</div>
                </div>
                <div class="layui-form-item">
                    <div>
                        <label class="layui-form-label">首页显示控制</label>
                        <div class="layui-input-inline">
                            <input type="text" name="site_config[home_page_show]" value="{$site_config.home_page_show|default='1,2'}"  placeholder="1:投稿排行榜 2实时投稿和兴趣图" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="label-tint">1:投稿排行榜 2实时投稿和兴趣图  多个以英文逗号分隔</div>
                </div>
                <div class="layui-form-item">
                    <div>
                        <label class="layui-form-label">用户注册</label>
                        <div class="layui-input-inline">
                            <input type="radio" name="site_config[reg_open]" value="1" title="开放" {if condition="@$site_config.reg_open eq 1" }checked{/if}>
                            <input type="radio" name="site_config[reg_open]" value="0" title="关闭" {if condition="@$site_config.reg_open eq 0" }checked{/if}>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div>
                        <label class="layui-form-label">用户中心</label>
                        <div class="layui-input-inline">
                            <input type="radio" name="site_config[user_center_status]" value="1" title="启用" {if condition="@$site_config.user_center_status eq 1" }checked{/if}>
                            <input type="radio" name="site_config[user_center_status]" value="0" title="关闭" {if condition="@$site_config.user_center_status eq 0" }checked{/if}>
                        </div>
                    </div>
                    <div class="label-tint">关闭用户中心则所有点击到用户中心的链接都会失效</div>
                </div>

                <div class="layui-form-item">
                    <div>
                        <label class="layui-form-label">后台安全码</label>
                        <div class="layui-input-inline">
                            <input type="radio" name="site_config[security_code]" value="1" title="使用验证码" {if condition="@$site_config.security_code eq 1" }checked{/if}>
                            <input type="radio" name="site_config[security_code]" value="2" title="使用安全码" {if condition="@$site_config.security_code eq 2" }checked{/if}>
                            <input type="radio" name="site_config[security_code]" value="0" title="都不使用" {if condition="@$site_config.security_code eq 0" }checked{/if}>
                        </div>
                    </div>
                    <div class="label-tint">后台登录开启此功能后可混淆非法登陆者（显示验证码实则需要输入安全码）</div>
                </div>
                <div class="layui-form-item">
                    <div>
                        <label class="layui-form-label">友链申请百度权重</label>
                        <div class="layui-input-inline">
                            <input type="number" name="site_config[apply_friendly_baidu_pr]" value="{$site_config.apply_friendly_baidu_pr|default=0}" required lay-verify="required" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="label-tint">低于此数字者会在申请友链时阻止</div>
                </div>
                <div class="layui-form-item">
                    <div>
                        <label class="layui-form-label">申请收录百度权重</label>
                        <div class="layui-input-inline">
                            <input type="number" name="site_config[apply_join_baidu_pr]" value="{$site_config.apply_join_baidu_pr|default=0}" required lay-verify="required" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="label-tint">低于此数字者会在申请收录时阻止</div>
                </div>
                <div class="layui-form-item">
                    <div>
                        <label class="layui-form-label">缩略图宽度</label>
                        <div class="layui-input-inline">
                            <input type="number" name="site_config[thumb_width]" value="{$site_config.thumb_width|default='400'}" required lay-verify="required"  autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="label-tint">单位：px;对于图片上传到本地有效</div>
                </div>
                <div class="layui-form-item">
                    <div>
                        <label class="layui-form-label">上传后缀</label>
                        <div class="layui-input-block">
                            <input type="text" name="site_config[upext]" value="{$site_config.upext|default='jpg,png,bmp,rar,zip'}" required lay-verify="required" placeholder="上传文件后缀" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="label-tint">jpg,png,bmp,rar,zip</div>
                </div>
                <div class="layui-form-item">
                    <div>
                        <label class="layui-form-label">上传限制(M)</label>
                        <div class="layui-input-inline">
                            <input type="text" name="site_config[upsize]" value="{$site_config.upsize|default='5'}" required lay-verify="required" placeholder="上传文件后缀" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">背景图案</label>
                    <div class="layui-input-inline" style="width: auto;margin-right:0px">
                        <button type="button" class="layui-btn" id="image">
                            <i class="layui-icon">&#xe67c;</i>上传图片
                        </button>
                    </div>
                    <div class="layui-input-inline" style="width: calc(100% - 300px);">
                        <input type="text" id="cover_img" name="site_config[background_img]" value="{$site_config.background_img|default=''}" class="layui-input">
                    </div>
                    <div class="coverBox" hidden >
                        <img src="__ADMIN__/images/default.png" alt="">
                    </div>
                    <div class="layui-input-inline" style="width: 20px;" id="viewCoverPic">

                        <a class="layui-btn layui-btn-primary" >预览</a>
                    </div>
                </div>
            </div>
        </div>

        <div class="layui-tab-item">
            <fieldset class="layui-elem-field layui-field-title">
                <legend>页面显示数量控制</legend>
            </fieldset>
            <div class="layui-form-item">
                <label class="layui-form-label" style="width:120px">首页推荐网站数</label>
                <div class="layui-input-inline" style="width:50px">
                    <input type="number" name="site_config[c_home_newlist]" value="{$site_config.c_home_newlist|default=14}" autocomplete="off" class="layui-input">
                </div>
                <label class="layui-form-label" style="width:120px">首页名站数</label>
                <div class="layui-input-inline" style="width:50px">
                    <input type="number" name="site_config[c_home_text]" value="{$site_config.c_home_text|default=21}" autocomplete="off" class="layui-input">
                </div>
                <label class="layui-form-label" style="width:120px">首页免费工具数</label>
                <div class="layui-input-inline" style="width:50px">
                    <input type="number" name="site_config[c_home_pic]" value="{$site_config.c_home_pic|default=8}" autocomplete="off" class="layui-input">
                </div>
                <label class="layui-form-label" style="width:120px">首页最新资源数</label>
                <div class="layui-input-inline" style="width:50px">
                    <input type="number" name="site_config[c_home_pic]" value="{$site_config.c_home_pic|default=8}" autocomplete="off" class="layui-input">
                </div>
                <label class="layui-form-label" style="width:120px">首页今日榜单数</label>
                <div class="layui-input-inline" style="width:50px">
                    <input type="number" name="site_config[c_list_main]" value="{$site_config.c_list_main|default=10}" autocomplete="off" class="layui-input">
                </div>
                <label class="layui-form-label" style="width:120px">首页最新资讯数</label>
                <div class="layui-input-inline" style="width:50px">
                    <input type="number" name="site_config[c_list_main]" value="{$site_config.c_list_main|default=10}" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label" style="width:120px">详情页数据图天数</label>
                <div class="layui-input-inline" style="width:50px">
                    <input type="number" name="site_config[c_view_main]" value="{$site_config.c_view_main|default=15}" autocomplete="off" class="layui-input">
                </div>
                <label class="layui-form-label" style="width:120px">详情页同类网站数</label>
                <div class="layui-input-inline" style="width:50px">
                    <input type="number" name="site_config[c_view_phb]" value="{$site_config.c_view_phb|default=10}" autocomplete="off" class="layui-input">
                </div>
            </div>
        </div>
        <div class="layui-tab-item">
            <div class="layui-form-item">
                <label class="layui-form-label">七牛存储</label>
                <div class="layui-input-inline">
                    <input type="radio" name="site_config[open_7niu]" value="1" title="开启" {if condition="@$site_config.open_7niu eq 1" }checked{/if}>
                    <input type="radio" name="site_config[open_7niu]" value="0" title="关闭" {if condition="@$site_config.open_7niu eq 0" }checked{/if}>
                </div>
                <a href="{:url('admin/system/qiniu')}" class="layui-btn layui-btn" style="float:left">
                    七牛配置
                </a>
            </div>
        </div>
        <div class="btable-paged">

                <div class="formbtngroup">
                    <span id="update-tips" style="line-height: 30px;"></span>
                    <button class="layui-btn layui-btn-sm" lay-submit="" title="" lay-filter="formadd">提交修改</button>
                </div>

        </div>
    </form>
</div>
{/block} {block name="script"}

<script>
    layui.use(['element', 'jquery', 'upload'], function() {
        var ajax_mail_test = "{:url('system/ajax_mail_test')}";
        var element = layui.element,
            upload = layui.upload,
            $ = layui.jquery; //导航的hover效果、二级菜单等功能，需要依赖element模块
        upload.render({
            elem: '#image',
            url: "{:url('upload/upimage')}",
            done: function (res) {
                if (res.code == '0') {
                    $('#cover_img]').val(res.data.src);
                    return layer.msg('上传成功');
                } else {

                    return layer.msg(res.msg);
                }

            }
        });
        $('#tpt_input').keydown(function(e) {
            if (e.which === 13) {
                $("#tpt_btn").click();
                e.preventDefault();
                return false;
            }
        });
        layer.tips('本页面修改后需要清除缓存', '#update-tips', {
            tips: [1, '#0FA6D8'] //还可配置颜色
        });
        $('#viewCoverPic').hover(function () {
            var box = $("div.coverBox");
            if ($('#cover_img').val().length>10){
                box.fadeIn(200);   box.find("img")[0].src=$('#cover_img').val();
            }
        },function () {
            $("div.coverBox").fadeOut(100)
        });
    });
</script> {/block} {block name="js"}
<script type="text/javascript" src="__ADMIN__/js/formadd.js"></script>
<script type="text/javascript" src="__ADMIN__/js/jquery-3.3.1.min.js"></script>
{/block}